package com.lingshi.shopping_category_customer_api.controller;

import com.lingshi.shopping_common.entity.Category;
import com.lingshi.shopping_common.result.BaseResult;
import com.lingshi.shopping_common.service.ICategoryService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 广告
 */
@RestController
@RequestMapping("/user/category")
public class CategoryController {
    @DubboReference
    private ICategoryService categoryService;
    /**
     * 查询全部启用广告
     */
    @GetMapping("/all")
    public BaseResult findAll() {
        List<Category> categories = categoryService.findAll();
        return BaseResult.success(categories);
    }

}
